package org.zhenggn.designpattern.chain;

/**
 * 进行权限检查的职责对象
 * Created by zhenggn on 2017/5/3.
 */
public class SaleSecurityCheck extends SaleHandler {
    public boolean sale(String user, String customer, SaleModel saleModel,User u) {
        if ("小李".equals(user)) {
            return this.successor.sale(user, customer, saleModel,u);
        } else {
            System.out.println("对不起" + user + "，你没有保存销售信息的权限");
            return false;
        }

    }
}
